package blazingbubble.graphics.lobby;

import blazingbubble.game.ILobbyGameEventListener;
import blazingbubble.graphics.IActivable;
import blazingbubble.lobby.command.LobbyCommandFactory;
import blazingbubble.game.command.GameCommandFactory;

import java.awt.*;

import javax.swing.JFrame;

public class Lobby implements IActivable {
	private IActivable current;

	private LobbyScreen lobbyScreen;
	private StartScreen startScreen;

	public Lobby(Container displayArea, LobbyCommandFactory commandFactory, GameCommandFactory gameCommandFactory, ILobbyGameEventListener lobbyGameEventListener, JFrame parentFrame) {
		lobbyScreen = new LobbyScreen(displayArea, commandFactory, gameCommandFactory, lobbyGameEventListener, parentFrame);
		startScreen = new StartScreen(displayArea, commandFactory);

		current = startScreen;
	}

	public void loginPerformed() {
		lobbyScreen.activate();
	}

	public LobbyScreen getLobbyScreen() {
		return lobbyScreen;
	}

	@Override
	public void activate() {
		current.activate();
	}

	public IGameListUpdateListener getGameListUpdateListener(){
		return lobbyScreen;
	}
}
